package com.lxh.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * <p>
 * 中国省市区
 * </p>
 *
 * @author lxh
 * @since 2022-03-01
 */
@Getter
@Setter
@TableName("china_city")
@ApiModel(value = "ChinaCity对象", description = "中国省市区")
public class ChinaCity extends Model {

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("名称")
    @TableField("name")
    private String name;

    @TableField("pid")
    private Integer pid;

    @TableField(exist = false)
    private List<ChinaCity> children;

}
